package org.lee.fms.web;

import org.lee.fms.service.IVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * HelloController
 *
 * @author dralee
 * @date 2021-12-29 10:54:29
 **/
@Controller
public class HelloController {

    @Autowired
    private IVersionService versionService;

    @RequestMapping("/index")
    public String index(Model model){
        return "index";
    }

    @GetMapping("/version.html")
    public ModelAndView version(){
        String version = versionService.getVersion();
        ModelAndView model = new ModelAndView("version");
        model.addObject("version", version);
        return model;
    }
}
